import { Application } from 'egg';

export default (app: Application) => {
    const { CHAR } = app.Sequelize;
    const model = app.model.define('Praise', {
        praise_id: { type: CHAR(32), primaryKey: true },//主键
        user_id: CHAR(32),//点赞人id
        target_id: CHAR(32),//被点赞对象id
        praise_type: CHAR(1),//被点赞类型（1：用户，2：解忧，3：评论）
        created_by: CHAR(32),//创建人
        updated_by: CHAR(32),//更新人
        is_delete: CHAR(1),//标识是否删除
    }, { tableName: 't_praise' });
    return model;
};

export class Praise {
    praise_id: string;
    user_id: string;
    target_id: string;
    praise_type: string;
    created_by: string;
    updated_by: string;
    is_delete: string;
}